import {getArticle,deleteArticle,getArticleMsg} from '@/api/article'
import {GET_ARTICLE_LIST} from '../actionTypes'

export const getArticleList = (params) => {
    return async (dispatch) => {
      const res = await getArticle(params)
    //   console.log(res.data)
      dispatch({
        type: GET_ARTICLE_LIST,
        payload: res.data
      })
    }
  }
// 删除文章
  export const delArticle = async (id) => {
    
     await deleteArticle(id)
    
  }
  
  // 获取文章详情
  export const getArticleInfo = async (id) =>{
   
      const res = await getArticleMsg(id)
     return res
    
  }